<?php
namespace app\index\controller;

use \app\common\libs\Lunar;

class Index
{
    public function index($date='')
    {	
    	$date = (empty($date) || !strtotime($date)) ? date("Y-m-d") : $date;

    	$lunar = new Lunar();
		$month = $lunar->getYinli($date);//将阳历转换为阴历

		$str = $month['year'].' 年 '.$month[1].' '.$month[2].' 属'.$month[6].' '.$month['constellation'];

		return ['date'=>$str];
	}
}
